home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / CW GUSI 1.6.4 / Examples / GUSIPAPTest.c < prev    next >
C/C++ Source or Header  |  1995-01-23  |  1KB  |  51 lines

  1. /*********************************************************************
  2. File        :    GUSI                -    Grand Unified Socket Interface
  3. File        :    GUSIPAPTest        -    Test PAP sockets
  4. Author    :    Matthias Neeracher <neeri@iis.ethz.ch>
  5. Language    :    MPW C
  6.  
  7. $Log: GUSIPAPTest.c,v $
  8. Revision 1.2  1994/12/31  01:06:30  neeri
  9. ANSIfy (omitting parameter names was illegal).
  10.  
  11. Revision 1.1  1994/02/25  02:47:26  neeri
  12. Initial revision
  13.  
  14. *********************************************************************/
  15.  
  16. #include <GUSI.h>
  17. #include "GUSITest.h"
  18. #include <stdio.h>
  19. #include <fcntl.h>
  20. #include <stdlib.h>
  21. #include <errno.h>
  22. #include <string.h>
  23.  
  24. #include "Events.h"
  25.  
  26. extern int GUSIDefaultSpin(spin_msg, long);
  27.  
  28. void Open(char ch1, char ch2, const char * line)
  29. {
  30.     sock    =    open("Dev:Printer", O_RDWR);
  31.     
  32.     if (sock == -1)    {
  33.         printf("# open() returned error %s\n", Explain());
  34.         Where();
  35.     }
  36. }
  37.  
  38. main(int argc, char ** argv)
  39. {
  40.     GUSISetup(GUSIwithSIOUXSockets);
  41.     GUSISetup(GUSIwithPAPSockets);
  42.     
  43.     printf("GUSIPAPTest        MN 15Feb93\n\n");
  44.  
  45.     COMMAND('o', 'p', Open,      "",                 "Open connection to printer");
  46.     
  47.     AddSocketCommands();
  48.     
  49.     RunTest(argc, argv);
  50.     CleanupSockets();
  51. }